home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 15
/
015.d81
/
force i
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
9KB
|
296 lines
1 rem force i gary v. fields sept. 1984
2 printchr$(147)chr$(5):poke53281,2:poke53280,2:goto35000
3 poke53281,0:poke53280,0:ifx>1then35032
4 v1=54296:h1=54273:l1=54272:a1=54277:s1=54278:w1=54276:cc=54272:sq=1
5 h2=54280:l2=54279:a2=54284:s2=54285:w2=54283:fs=700:dr=5:am=10:ge=5
10 ch$=chr$(147):h$=chr$(19):sc=12
22 gosub50:gosub35032
23 print"":gosub30000:poke1944+cc,2:goto1000
24 pokew1,0:pokev1,15:pokeh1,255:pokel1,0:pokea1,180:pokes1,240:pokew1,33:return
25 pokew1,0:pokev1,15:pokeh1,0:pokel1,200:pokea1,140:pokes1,0:pokew1,33:return
27 pokew1,0:pokeh1,12:pokel1,120:pokea1,8:pokes1,0:pokew1,129:return
28 pokew1,130:pokeh1,2:pokel1,120:pokew1,129:return
29 pokew1,130:pokeh1,2:pokel1,2:pokea1,60:pokes1,0:pokew1,129:return
30 tf=1:rp=peek(ep):ifrp<33orrp>46thentf=0
31 forb=1totc:ifep=et(b)thenet(b)=1944:poke1944,34:ed=ed+1:re=re-1
32 next:ifep=mtthendr=dr-1:gosub150
33 gosub25:ford1=0to50:next:gosub27:pokeep,60:pokeec,5:ford1=0to15:next
34 gosub28:pokeep,62:pokeec,7:ford1=0to70:next
35 gosub29:ford1=0to250:next:pokeep,63:pokeec,8:ford1=0to250:next
36 pokeep,32:pokeec,0
37 ifrp=46thentf=0:rp=0:goto34
38 iftf=1andrp<37thenpokeep,62:pokeec,11:goto1100
39 pokeep,32:pokeec,0:return
40 ford1=54272to54296:poked1,0:nextd1:return
45 l%=int(rnd(0)*3)+2:return
50 gosub40:pokev1,2:pokeh1,0:pokel1,240:pokea1,0:pokes1,240:pokew1,33:return
52 pokev1,6:pokeh1,1:ford1=0to200:next:fs=fs-5:return
55 iffs<1thenfs=0:y=6:gosub1530:gosub1530:gosub1530
56 return
60 pokeet(e),32:pokeet(e)+cc,0:return
100 ifdx<1thendx=1:return
102 ifdy<1thendy=1:return
104 ifdx>38thendx=38:return
105 ifdy>16thendy=16:return
106 ifmt-ud<1104then130
107 ifmt+ud>1783then130
108 pokemt,32:pokemt+cc,0:mt=mt+ud
109 ifpeek(mt)=32then130
110 ifmt=obthenreturn
112 ifpeek(mt)=46thenep=mt:ec=mt+cc:gosub30:y=6:goto130
116 ifpeek(mt)=38thenfs=fs-6:gosub40:gosub52:y=y+2:goto130
118 ifpeek(mt)=42thenfs=1000:am=30:goto130
120 ifpeek(mt)<>32thenmt=mt-ud
122 ifts=36thendx=dx+1
123 ifts=33thendy=dy-1
124 ifts=34thendx=dx-1
125 ifts=35thendy=dy+1
130 pokemt,ts:pokemt+cc,6:return
140 ifsc<1thenreturn
141 x=0:nd=int(rnd(0)*400)+1144
142 nd=nd+1:x=x+1:ifpeek(nd)>32andpeek(nd)<37thenpokend+cc,2
143 ifpeek(nd)=46thenpokend+cc,2
144 ifx>39thenfs=fs-70:sc=sc-1:y=y+1:return
145 j=1:ifsc>9thenj=0
146 printh$tab(25)"scouts@"spc(j)sc:goto142
150 j=1:ifsc>9thenj=0
151 printh$" reports @";tab(14)chr$(18)"[151]force[160]i[146]";tab(25)"scouts@"spc(j)sc
152 as=0:ifam<10thenas=1
153 printh$:ford1=0to17:print:next:iffs<1thenfs=0
154 print"[153]gun elev@";ge;tab(14)"ammo [154]'@"spc(as)am;
155 printtab(26)"[149]fuel@ ":printchr$(145)tab(33)fs:ifdr<1thendr=0:y=6
156 print"[154]! damage@"dr;:printtab(20)"sq/mile@"sq:printtab(1)" count@"ed;
157 printtab(20)"[f7]@scouts "
158 print" return@ pass"tab(20)"[f8]@restart";
161 return
200 ifpeek(mt)=33thenep=mt-(ge*40):t%=33
202 ifpeek(mt)=34thenep=mt+ge:t%=34:goto223
204 ifpeek(mt)=35thenep=mt+(ge*40):t%=35
206 ifpeek(mt)=36thenep=mt-ge:t%=36:goto223
209 ifge>3thenl%=int(rnd(0)*2)+1:ep=ep+l%-2:goto220
210 ifge=3thenl%=int(rnd(0)*2):ep=ep+l%:goto220
220 ec=ep+cc:gosub30:return
223 ifge<3then220
224 ifge=3thenl%=int(rnd(0)*2)+2
225 ifge>3thengosub45
227 ifge>6thenl%=int(rnd(0)*5)+1
230 onl%goto231,232,233,234,235
231 ep=ep+80:goto220
232 ep=ep+40:goto220
233 ep=ep:goto220
234 ep=ep-40:goto220
235 ep=ep-80:goto220
300 gosub52:y=y+1:ifpeek(mt)<>36thenpokemt,36:fs=fs-6:ts=36:return
302 ud=-1:dx=dx-1:goto100
400 gosub52:y=y+1:ifpeek(mt)<>33thenpokemt,33:fs=fs-2:ts=33:return
402 ud=-40:dy=dy+1:goto100
500 gosub52:y=y+1:ifpeek(mt)<>34thenpokemt,34:fs=fs-6:ts=34:return
502 ud=1:dx=dx+1:goto100
600 gosub52:y=y+1:ifpeek(mt)<>35thenpokemt,35:fs=fs-2:ts=35:return
602 ud=40:dy=dy-1:goto100
610 forx=0todsteps
611 if(et(e)+x-mf)=mtthengosub45:ep=mt:gosub230:gosub650:x=d
612 if(et(e)+x-mf)=dp+1thenep=dp+1:ec=dp+1+cc:gosub30:gosub650:gosub30:x=d
619 next:return
650 ford1=0to100:next:return
700 ife>axthene=0:return
702 ifre<1thenreturn
704 pt=0:ifabs(mt-et(e))<160thenpt=2
705 ifet(e)>1783thenreturn
706 ifet(e)<1104thenreturn
707 ifet(e)>1600thengosub45:ep=dp+1:gosub230
708 ifdy>11thenifre>2thengosub45:ep=ob:gosub230
709 ifdr<1thenreturn
710 ifnd>15thend=520:s=40:mf=120:pokeet(e),ch:gosub610
714 ifnd>20thend=12:s=1:mf=12:pokeet(e),36:gosub610:ifl%>3thengosub610
715 ifnd>40thend=12:s=1:mf=0:pokeet(e),34:gosub610:ifl%>4thengosub610
716 ifnd<15thend=240:s=-80:mf=120:pokeet(e),ch:gosub610:ifl%>3thengosub610
717 ifdr<1thenreturn
720 ifabs(et(e)-mt)=1thenep=mt:ec=mt+cc:gosub30
722 ifabs(et(e)-mt)=40thenep=mt:ec=mt+cc:gosub30
725 ifet(e)+40>1702anddy<3thengosub45:ep=dp+1:gosub230:goto735
730 ifmt-et(e)>20thench=35:wa%=40:goto740
732 ifmt-et(e)<-20thench=33:wa%=-40:goto740
733 ifet(e)<mtthenifet(e)-mt<dxthench=34:wa%=1:goto740
734 ifet(e)>mtthenifet(e)-mt<39thench=36:wa%=-1:goto740
735 wa%=0:ch=35:return
740 ey=peek(et(e)+wa%):ifey<>32thengosub900
800 pokeet(e),32:et(e)=et(e)+wa%:pokeet(e),ch:pokeet(e)+cc,pt:return
900 ifey=38thenreturn
902 ifey=46thengoto995
904 ifey>36theney=int(rnd(0)*20):ifey>15thengoto995
906 ey=int(rnd(0)*4)+1
908 ifey=1then735
910 ifey=2thenifpeek(et(e)+1)=32thenwa%=1:ch=34:return
912 ifey=3thenifpeek(et(e)-1)=32thenwa%=-1:ch=36:return
914 ifey>3thenifpeek(et(e)-40)=32thenwa%=-40:ch=33:return
990 goto735
995 ep=et(e)+wa%:ec=ep+cc:gosub30:return
1000 fs=fs-1:gosub50:gosub150:ifdr<1then4050
1001 gosub1200:gosub2500:y=0:poke198,0
1002 printh$"[154] move cmd@":gosub55
1003 gosub1200:iffs>0thenonjvgosub400,600,1525,300,1525,1525,1525,500
1004 gosub40:gosub50:getq$:ifq$=chr$(140)then4050
1005 gosub1140:ifmt=obandoc=1then5000
1006 ifq$=chr$(160)thengosub4060
1007 ifq$=chr$(136)thengosub140
1008 ifq$=chr$(13)theny=6
1009 iffs<1andam<1thengosub152:goto4050
1010 gosub152:ify<6then1002
1011 poke198,0:fl=4:gosub2501:printh$chr$(18)"enemy move"
1012 nd=int(rnd(0)*150)+1:ifnd>100andpeek(dp+1)=32thenpokedp+1,42:pokedp+cc+1,6
1013 ifnd<50thenpokeob,44:pokeob+cc,2
1014 gosub2000:ifdr<1then4050
1015 ifdy>14andre>2thengosub1500
1017 ifre<2then1028
1018 ifnd>80thenifdr>1thengosub1500
1028 oc=0:ifpeek(ob)=44thenoc=1
1029 ifq$=chr$(13)thengosub45:ifl%=3thengosub1530
1030 goto1000
1100 iftf=1thenifep=mtthenifdr>0thentf=int(rnd(0)*4)+1:pokemt,tf+32:tf=0
1140 ifq$="e"thengosub400
1141 ifq$="x"thengosub600
1142 ifq$="d"thengosub500
1143 ifq$="s"thengosub300
1144 ifdy>13thenifre>2thenifdr>0thenl%=int(rnd(0)*2)+2:ep=mt:gosub230
1145 ifdr<1theny=6
1146 gosub50:return
1200 jv=peek(56320):fr=jvand16:jv=15-(jvand15):return
1500 ifdy>12andre>1then1530
1508 ifdy>8andre>2then1530
1510 ifdy>6andre>3then1530
1515 ifdy>3andre>4then1530
1520 ey=int(rnd(0)*20):ifey>18then1530
1525 return
1530 printh$"incoming@'":x=int(rnd(0)*6)-3:ep=mt+x:ec=ep+cc
1532 gosub24:ford1=0to500:next:gosub40:gosub30
1540 return
2000 fore=0toax:ifet(e)=1944then2004
2002 gosub700:ifdr<1thene=ax
2004 nexte:return
2500 poke198,0:fl=am
2501 ifdr<1thenreturn
2502 fory=0tofl:printh$chr$(18)" gun cmd @":getq$
2503 ifq$=chr$(13)theny=fl:goto2620
2504 ifq$=chr$(134)thenge=ge+1:ifge>8thenge=9
2505 ifq$=chr$(160)thengosub4060
2506 ifq$=chr$(135)thenge=ge-1:ifge<2thenge=1
2507 ifq$=chr$(140)then4050
2508 ifmt<1265andpeek(mt)=33andge>3thenge=3
2510 ifdx<9thenifpeek(mt)=36thenifge>dxthenge=dx
2512 ifdx>31thenifpeek(mt)=34thenifge>39-dxthenge=39-dx
2514 ifdy<5thenifpeek(mt)=35thenifge>5thenge=5
2600 printh$"[150] fire cmd@"
2604 gosub1200
2605 ifam<1thenam=0:goto2620
2610 ifq$=chr$(133)thenfr=0
2612 iffr=0thenam=am-1:gosub200:fs=fs-2
2620 fs=fs-1:gosub152:nexty:return
4050 poke198,0:printh$:print:print:print:print"try again [y/n]"
4052 getq$:ifq$=""then4052
4054 ifq$="y"thenprintch$:clr:x=1:goto3
4056 ifq$<>"n"then4052
4058 gosub40:sys64738
4060 poke198,0:printh$"[158] pause "
4062 getq$:ifq$=""then4060
4063 printh$" ":return
5000 gosub40:ifsq>5then5008
5002 sq=sq+1:dr=dr+1:sc=12:zx=0::fs=1000:am=am+15:ifam>24thenam=24
5004 goto23
5008 printchr$(147)"the battle is won"
5010 ed=ed*2:forx=1toed:l%=int(rnd(0)*4)+1:poke1104+x,l%+32:poke1104+x+cc,2
5011 x=x+1:forsq=0to50:nextsq:next
5012 poke1964,33:poke1964+cc,6
5014 forx=1toed:ep=1104+x:ec=ep+cc:gosub24:ford1=0to100:nextd1:gosub30
5016 p